package common

import (
	"fmt"
)

const AdminAuth = "admin_auth"
const Base = "base"
const auth = "auth"
const wx = "wx"
const Calculate = "calculate"

func (s *Redis) GetAdminAuthLoginKey(uid string) string {
	return fmt.Sprintf("%s:login:%s", AdminAuth, uid)
}

func (s *Redis) GetBaseAlgorithmConfigKey() string {
	return fmt.Sprintf("%s:algorithm_config", Base)
}

func (s *Redis) GetBaseDesignScanKey(uuid string) string {
	return fmt.Sprintf("%s:design_scan_%s", Base, uuid)
}

func (s *Redis) GetBaseBatchCreateFashionConsumeKey() string {
	return fmt.Sprintf("%s:batch_create_fashion_consume", Base)
}

func (s *Redis) GetBaseBatchCreateFashionLastNumKey() string {
	return fmt.Sprintf("%s:batch_create_fashion_last_num", Base)
}

func (s *Redis) GetAuthUserTokenKey(uid string) string {
	return fmt.Sprintf("%s:user_token_%s", auth, uid)
}

func (s *Redis) GetWxSessionKey(uid string) string {
	return fmt.Sprintf("%s:session_%s", wx, uid)
}

func (s *Redis) GetWxAccesstokenKey(appid string) string {
	return fmt.Sprintf("%s:accesstoken_%s", wx, appid)
}

func (s *Redis) GetProductionMaterialConsume() string {
	return "production_material_consume"
}

func (s *Redis) GetComposingMaterialConsume() string {
	return "composing_material_consume"
}

func (s *Redis) GetConfirmAmountKey(orderId string) string {
	return fmt.Sprintf("confirm_amount_%s", orderId)
}

func (s *Redis) GetCalculateQueueKey(id int64) string {
	return fmt.Sprintf("%s:queue_lock_%d", Calculate, id)
}

func (s *Redis) GetUploadFashionObjKey(id string) string {
	return fmt.Sprintf("%s:upload_fashion_obj_%s", Base, id)
}
